From 9fb9651ac51bef79865829d5f40e54ad23898bd3 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 21 Jun 2006 16:54:09 +0100 Subject: [PATCH] [LINUX] Transparent virtualization fixes. Signed-off-by: Tristan Gingold --- linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c | 4 ++-- linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c | 3 +++ linux-2.6-xen-sparse/drivers/xen/core/evtchn.c | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index b8aca26778..bb5cd5e7a4 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -468,11 +468,11 @@ static int __init balloon_init(void) unsigned long pfn; struct page *page; - IPRINTK("Initialising balloon driver.\n"); - if (!is_running_on_xen()) return -ENODEV; + IPRINTK("Initialising balloon driver.\n"); + current_pages = min(xen_start_info->nr_pages, max_pfn); totalram_pages = current_pages; target_pages = current_pages; diff --git a/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c b/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c index 9eaed5b3a2..0969e213a0 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c @@ -109,6 +109,9 @@ static int __init setup_vcpu_hotplug_event(void) static struct notifier_block xsn_cpu = { .notifier_call = setup_cpu_watcher }; + if (!is_running_on_xen()) + return -ENODEV; + register_cpu_notifier(&hotplug_cpu); register_xenstore_notifier(&xsn_cpu); diff --git a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c index 9ef160f482..7d57e105a4 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c @@ -666,6 +666,10 @@ static struct hw_interrupt_type pirq_type = { int irq_ignore_unhandled(unsigned int irq) { struct physdev_irq_status_query irq_status = { .irq = irq }; + + if (!is_running_on_xen()) + return 0; + (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status); return !!(irq_status.flags & XENIRQSTAT_shared); } -- 2.30.2